# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kxmlgui
pkgver=5.72.0
pkgrel=0
pkgdesc="User configurable main windows"
arch="all !armhf"
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-only AND LGPL-2.1-or-later"
depends_dev="qt5-qtbase-dev kcoreaddons-dev kitemviews-dev kconfig-dev kconfigwidgets-dev ki18n-dev kiconthemes-dev ktextwidgets-dev kwidgetsaddons-dev kwindowsystem-dev attica-dev kglobalaccel-dev"
makedepends="$depends_dev extra-cmake-modules doxygen qt5-qttools-dev"
checkdepends="xvfb-run mesa-dri-swrast"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kxmlgui-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	cd build
	# 2 out of 5 tests fail
	LC_ALL=C CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest -E '(kxmlgui_unittest|ktoolbar_unittest)'
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}
sha512sums="368e48c046441f525695f1c22cec13a893bb0ef8190d41c862aefbcdc45583268127de4c2deecff2eb0e1a82788c7ca677537a3e07d82879f11f8e5498165b12  kxmlgui-5.72.0.tar.xz"
